<?php $this->load->view('friends/header',array('title'=>'好友')); ?>
<div id="wrapper" class="clearfix">
	<div id="main" class="clearfix">
		<div id="content" class="clearfix" >
			<div class="content-l">
				<?php $this->load->view('_menu_main'); ?>
			</div>
			<div class="content-r">
				<div id="friend-search">
					<h2 class="sub-title t-friends">好友</h2>
					<div class="rt-search">
						<form id="friends-search" onsubmit="search();return false;">
						<input class="textbox-sqa" type="text" tabindex="1" id="txt-search"/>
						<input class="btn-sqa" type="sUbmit" value="搜索"/>
						</form>
					</div>
				</div>
				<div id="friends-tabs">
					<ul>
						<li class="tab-listview"><a href="<?php echo base_url();?>friends/listview">好友列表</a></li>
						<li class="tab-find"><a href="<?php echo base_url();?>friends/find">好友推荐</a></li>
						<li class="tab-search"><a href="<?php echo base_url();?>friends/search">好友搜索</a></li>
						<li class="tab-request"><a href="<?php echo base_url();?>friends/request">好友申请</a></li>
					</ul>
				</div>
				<div id="friends-contents">
					<?php switch($friend_model){
						case "list":
							$ldata=array('friends'=>$friends);
							$this->load->view('friends/list',$ldata);
							break;
						case "find":							
							$this->load->view('friends/find');					
							break;
						case "request":
							$this->load->view('friends/request');
							break;
						default:
							//$this->load->view('setting/basic');
							?>
							default
							<?php
						break;
					}
		 			?>
				</div>
			</div>
		</div>
	</div>
</div>
<?php $this->load->view('friends/footer'); ?>
<script type="text/javascript">
	$(function(){
		settingsTab();
		$("#navigator li").click(function(){
			$("#navigator .active").removeClass("active");
			$(this).addClass("active");
		});
	});
	
	//select Tab
	function settingsTab(){
		var curUrl=location.href.toLowerCase();
		var start=curUrl.lastIndexOf("/");
		var val=curUrl.substr(start+1,curUrl.length-start);
		
		$(".tab-"+val).addClass("active");
		if(val=="friends")
			$(".tab-listview").addClass("active");
	}
	
	function search(){
		flash_success_message("功能开发中");
	}	
</script>
